//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.restaurant.application.minifacade.data;

import com.google.common.collect.Lists;
import com.nebutown.generation.Convert;
import com.nebutown.generation.PickableBean;
import java.util.List;

public class CardPageBO implements PickableBean {
    public static final String FN_CARDID = "cardId";
    public static final String FN_VERSION = "version";
    public static final List<String> FIELD_NAMES = Lists.newArrayList(new String[]{"cardId", "version"});
    private String cardId;
    private Integer version;

    public CardPageBO(String cardId, Integer version) {
        this.setCardId(cardId);
        this.setVersion(version);
    }

    public CardPageBO() {
    }

    public CardPageBO duplicate() {
        CardPageBO result = new CardPageBO();
        result.cardId = this.cardId;
        result.version = this.version;
        return result;
    }

    public String toString() {
        return Convert.toJson(this);
    }

    public String getCardId() {
        return this.cardId;
    }

    public void setCardId(String value) {
        this.cardId = value;
    }

    public CardPageBO withCardId(String value) {
        this.setCardId(value);
        return this;
    }

    public CardPageBO withCardId(String value, String defaultValue) {
        this.setCardId(value == null ? defaultValue : value);
        return this;
    }

    public Integer getVersion() {
        return this.version;
    }

    public void setVersion(Integer value) {
        this.version = value;
    }

    public CardPageBO withVersion(Integer value) {
        this.setVersion(value);
        return this;
    }

    public CardPageBO withVersion(Integer value, Integer defaultValue) {
        this.setVersion(value == null ? defaultValue : value);
        return this;
    }

    public Object getValueOf(String name) {
        byte var3 = -1;
        switch(name.hashCode()) {
            case -1367605173:
                if (name.equals("cardId")) {
                    var3 = 0;
                }
                break;
            case 351608024:
                if (name.equals("version")) {
                    var3 = 1;
                }
        }

        switch(var3) {
            case 0:
                return this.getCardId();
            case 1:
                return this.getVersion();
            default:
                return null;
        }
    }

    public boolean hasField(String name) {
        return FIELD_NAMES.contains(name);
    }

    public int hashCode() {
        return this.signature().hashCode();
    }

    public boolean equals(Object o) {
        return !(o instanceof CardPageBO) ? false : this.signature().equals(((CardPageBO)o).signature());
    }

    public String signature() {
        throw new RuntimeException("Bean CardPageBO has no signature defined, no hash code or equals possible.");
    }
}
